import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';

export class CreateServiceDto {
  @IsNotEmpty()
  @ApiProperty({ required: true })
  @IsString()
  category: string;

  @IsOptional()
  @ApiProperty({
    description: '服务的描述',
  })
  @IsString()
  description: string;

  @IsOptional()
  @ApiProperty({
    description: '服务的照片',
  })
  @IsString()
  photo: string[];

  @IsOptional()
  @ApiProperty({
    description: '该项服务的服务点',
  })
  @IsString()
  service_point: string;

  // 发布这个服务的商家的id
  @IsNotEmpty()
  @ApiProperty({ required: true, description: '商家的id' })
  @IsNumber()
  shopId: number;

  // 发布服务的店铺名称ID
  @IsNotEmpty()
  @ApiProperty({ required: true, description: '店铺ID' })
  shopNameId: string;

  @IsOptional()
  @ApiProperty({
    description: '服务的价格',
  })
  @IsNumber()
  money: number;

  @IsNotEmpty()
  @ApiProperty({
    description: '该项服务所在的省份',
  })
  @IsString()
  province: string;

  @IsNotEmpty()
  @ApiProperty({
    description: '该项服务所在的城市',
  })
  @IsString()
  city: string;
}
